import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ParsingWithGroups {

	public static void main(String[] args) {
		String text = 
			"george 62.44.18.124 02:44:50\n" +
			"admin 193.168.22.18 22:12:38\n" +
			"nakov 217.9.231.126 00:07:24";
		Pattern pattern = Pattern.compile( 
			"(\\S+)\\s+([0-9\\.]+)\\s+([0-9:]+)");
		Matcher matcher = pattern.matcher(text);
		while (matcher.find()) {
			String name = matcher.group(1);
			String ip = matcher.group(2);
			String time = matcher.group(3);
			System.out.printf("Name=%s IP=%s time=%s\n",
				name, ip, time);
		}
	}
	
}
